<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of testpayment
 *
 * @author Samuel
 */
require_once 'BaseChannel.php';

class Testpayment implements BaseChannel {

    function __construct() {
        //echo "construct";
    }

    //put your code here
    function android($data) {
       		$status = 1;
			$channel = 'aiwanyou';
			$platform="1";
			$orderID='';
			$money = 6;
			$order = new ChargeOrder();
        	$order->log($channel, $_POST);
            $res = $order->recordOrder($status, $money, $orderID, $channel, $platform);
        echo $res;
    }

    function ios($data) {
			$status = 1;
			$channel = 'aiwanyou';
			$platform="0";
			$orderID='';
			$money = 6;
			$order = new ChargeOrder();
        	$order->log($channel, $_POST);
            $res = $order->recordOrder($status, $money, $orderID, $channel, $platform);

        echo $res;
    }
	
    /*
     * 支付回调测试代码
     * 成功返回true 失败返回false
     */
    function pay($row)
    {
    	//print_r($row);
    	$status = $row['status'];
		$channel = $row['channel'];
		$platform=$row['platform'];
		$orderid=$row['orderid'];
		$money = $row['money'];
		$order = new ChargeOrder();
        $order->log($channel, $_POST);
        $res = $order->recordOrder($status, $money, $orderid, $channel, $platform);
        return $res;
    }

}

?>
